﻿namespace ImapComponent.Net.Mail.Security
{
    using System.Net;
    using System.Security.Cryptography.X509Certificates;

    /// <summary>
    /// The trust certificate policy.
    /// </summary>
    public class TrustCertificatePolicy : ICertificatePolicy
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the TrustCertificatePolicy class.
        /// </summary>
        public TrustCertificatePolicy()
        {
        }

        #endregion // Constructors

        #region ICertificatePolicy Members

        /// <summary>
        /// Accepts certificate without validation.
        /// </summary>
        /// <param name="srvPoint">The ServicePoint that will use the certificate. </param>
        /// <param name="certificate">The certificate to validate. </param>
        /// <param name="request">The request that received the certificate. </param>
        /// <param name="certificateProblem">The problem that was encountered when using the certificate. </param>
        /// <returns>true</returns>
        public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
        {
            return true;
        }

        #endregion // ICertificatePolicy Members
    }
}
